package o;

import com.huawei.appgallery.forum.base.card.bean.Options;
import com.huawei.appgallery.forum.base.https.jgw.JGWTabInfo;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;

public class cau {
    public String ˊ(JGWTabInfo jGWTabInfo, int i) {
        StringBuilder stringBuilder = new StringBuilder();
        String ʼ = jGWTabInfo.ʼ();
        stringBuilder.append(ʼ);
        stringBuilder.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(i);
        ʼ = cat.ˋ().ˋ(ʼ);
        if (dof.ॱ(ʼ)) {
            Options ˊ = jGWTabInfo.ˊ();
            if (ˊ != null) {
                ʼ = ˊ.ॱ();
                if (ʼ != null) {
                    stringBuilder.append(",orderby_").append(ʼ);
                }
            }
        } else {
            stringBuilder.append(",orderby_").append(ʼ);
        }
        return stringBuilder.toString();
    }

    public String ˎ(String str, int i, String str2) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(str);
        stringBuilder.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(i);
        stringBuilder.append(",orderby_").append(str2);
        return stringBuilder.toString();
    }

    public String ˎ(String str) {
        if (str == null) {
            return null;
        }
        int lastIndexOf = str.lastIndexOf(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
        if (-1 == lastIndexOf) {
            return null;
        }
        int indexOf = str.indexOf(",", lastIndexOf);
        if (-1 == indexOf) {
            if (lastIndexOf + 1 < str.length()) {
                return str.substring(lastIndexOf + 1);
            }
            return null;
        } else if (indexOf + 1 <= str.length()) {
            return str.substring(lastIndexOf + 1, indexOf);
        } else {
            return null;
        }
    }
}
